<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #editor{
            width: 90%;  
            height: 200px;  
            border: 1px solid #ccc;  
            padding: 10px;  
            font-family: monospace;  
            outline: none; /* 移除浏览器默认的outline */  
        }
    </style>
</head>
<body>
    <div id="editor" contenteditable="true"></div>
    <button class="btn1">按钮1</button>
    <button class="btn2">按钮2</button>
    <script>
        var btn1 = document.querySelector('.btn1');
        var btn2 = document.querySelector('.btn2');
        btn1.onclick = function(e){
            
        }
    </script>
</body>
</html>